Catalog npm
Back to packageRELEASE DETAILS

0.2.2

npm

1664

Sort safe base16 to/from base64 conversion with filename and url safe characters written in pure javascript

Published17 Mar 2014
Direct dependencies5
Transitive dependenciesNot calculated

README

Current package documentation

1664

Sort safe base16 to/from base64 conversion with filename and url safe characters written in pure javascript

Install

npm install 1664

Usage

Note: API changed with 0.2.x depreciates base.to16 and base.to64

MD5 example

base   = require('1664')
base.to16('z') // depreciated
base.to64('f') // depreciated
base16 = base.base16
base64 = base.base64
MD5    = require('MD5')
md5    = MD5('hello')
md564  = base16.to64(md5)
md5b   = base64.to16(md564)

// alternate:
md564  = base64.from16(md5)
md5b   = base16.from64(md564)

console.log(md5.length,   md5)    // 32 '5d41402abc4b2a76b9719d911017c592'
console.log(md564.length, md564)  // 22 '1TGK0fk4hfTgamcP4G5xMI'
console.log('same?', (md5==md5b)) // same? true

// date string
console.log(base64.fromDate('2012-10-18 02:57:49')) // 2AI2um
console.log(base64.toDate('2AI2um'))                // 2012-10-18 02:57:49

SHA-512 example

base16 = require('1664').base16
SHA    = require('jssha')
shaObj = new SHA("hello", "TEXT")
hash   = shaObj.getHash("SHA-512", "HEX")
hash64 = base16.to64(hash)
hashb  = base16.from64(hash64)

console.log(hash.length,   hash)    // 128 '9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043'
console.log(hash64.length, hash64)  // 86 '2RST8_kMBoU5rMq6gJvZqoCPkwld_CfigYs~Sa6MSxenCZlybReS4TV7gCRXItmTdCHbD7N2uSEiwpRsExsh13'
console.log('same?', (hash==hashb)) // same? true

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 5

Native requirements
5 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
bignum
Environment
{
  "local_name": "bignum",
  "alias": false,
  "peer_metadata": null
}
^0.6.2runtime
grunt
Environment
{
  "local_name": "grunt",
  "alias": false,
  "peer_metadata": null
}
^0.4.3development
grunt-bump
Environment
{
  "local_name": "grunt-bump",
  "alias": false,
  "peer_metadata": null
}
0.0.13development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^1.17.1development
should
Environment
{
  "local_name": "should",
  "alias": false,
  "peer_metadata": null
}
^3.1.3development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "68775839a03f07d9ca2332219fbfe957a8b76080",
  "tarball": "https://registry.npmjs.org/1664/-/1664-0.2.2.tgz",
  "integrity": "sha512-erSnJdXmqJaetXNFuaTSUPsJG3h+V3zzRRTqlIMIoHYnckq4tmMa6BXtYEFVUKWDGv5jGog51yEGciuCGuekDw==",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIBCQAyGtSTgla4b/Rz98FV7BYD6iJEEVx947OMpnYzaZAiA3j2c6ueJUBqVDHS5oOw/DYzYgWVOo8q2cVexCeJxtuA=="
    }
  ]
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:16 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:a9f8dd7a2e0c50ac4bfb93c418acf2c05f636c3be3d320fd2f067bd2b4902dfb

Other collected versions

0.3.225 Mar0.3.120 Mar0.2.317 Mar0.2.117 Mar0.1.113 Mar0.1.013 MarView all collected versions →