Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pfrazee/pretty-hash
Output binary buffers as a nice shortened hex string
https://github.com/pfrazee/pretty-hash
Last synced: 2 months ago
JSON representation
Output binary buffers as a nice shortened hex string
- Host: GitHub
- URL: https://github.com/pfrazee/pretty-hash
- Owner: pfrazee
- Created: 2016-11-17T20:06:23.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-14T13:50:01.000Z (over 5 years ago)
- Last Synced: 2024-10-17T17:37:09.187Z (2 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 27
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pretty-hash
Output binary buffers as a nice shortened hex string
```js
var prettyHash = require('pretty-hash')
var crypto = require('crypto')prettyHash(crypto.randomBytes(32)) // => '0b0a97..f3'
prettyHash(crypto.randomBytes(16)) // => '0b0395..8a'
prettyHash(crypto.randomBytes(4)) // => '49ab09ed'
prettyHash(crypto.randomBytes(1)) // => 'f8'
```