0.0.9 • Published 7 years ago

in-cook-out v0.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

in-cook-out

Describe

A collection of common functions

Function List

  • convertForBytes(value: Number)

    	*transform a number to B、KB、MB、GB、TB、PB、EB、ZB、YB with unit.*
  • convertForBytesNum(value: Number)

    	*transform a number to B、KB、MB、GB、TB、PB、EB、ZB、YB without unit.*
  • hzUnitConvert(value: Number)

    	*transform a number to MHz、GHz with unit.*
  • percentConvert(value: Number)

    	*tranform a number to percent with %.*
  • deepCopy(obj: Object)

    	*create an new object is exactly equal to orign object.*
  • formatSeconds(seconde: Number)

    	*transform a number to time with unit, such as ‘时’、‘分’、‘秒’.*
  • formatMilliseconds(ms: Number)

    	*transform a number to time with unit such as '毫秒'、'秒'、'分'、'时'*
  • codeFormat.utf16to8(str: String)

    	*tranform utf-16 to utf-8.*
  • codeFormat.utf8to16(str: String)

    	*tranform utf-8 to utf-16.*
  • codeFormat.base64encode(str: String)

    	*encode a string by base64.*
  • codeFormat.base64decode(str: String)

    	*decode a string by base64.*
  • codeFormat.charToHex(str: String)

    	*transform a character to hexadecimal.*
  • netRange(ip: String, mask: String)

netRnage('192.168.12.12', '255.255.255.0'); 
=> //'192.168.12.0'
  • maskConvert(mask: String)
maskConvert('255.255.255.0');
=> //24
  • ipRangeConvertToMask(iprange: String)
ipRangeConvertToMask('192.168.12.0/24');
=> //'255.255.255.0';
  • ipRangeConvert(ip: String, mask: String)
ipRangeConvert('192.168.12.12', '255.255.255.0');
=> //'192.168.12.0/24';

Contact

Authors

  • cool_fish(haoyu953@163.com)

License

Licensed under the MIT License

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago