Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nhz-io/nhz-io-md5
https://github.com/nhz-io/nhz-io-md5
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nhz-io/nhz-io-md5
- Owner: nhz-io
- License: mit
- Created: 2017-11-13T06:37:31.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-13T06:54:52.000Z (about 7 years ago)
- Last Synced: 2024-12-09T05:29:42.324Z (16 days ago)
- Language: CoffeeScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.litcoffee
- License: LICENSE
Awesome Lists containing this project
README
# Calculate MD5 Digest of a sting (hex)
[![Travis Build][travis]](https://travis-ci.org/nhz-io/nhz-io-md5)
[![NPM Version][npm]](https://www.npmjs.com/package/@nhz.io/md5)## Install
```bash
npm i -S @nhz.io/md5
```## Usage
```js
const md5 = require('@nhz-io/md5')const digest = md5('foobar')
...
```
## Importscrypto = require 'crypto'
md5 = (string) ->
hash = crypto.createHash 'md5'
hash.update string
hash.digest 'hex'
## Exports
module.exports = md5
## Tests
assert = require 'assert'
assert.ok (md5 'foobar') is '3858f62230ac3c915f300c664312c63f'
console.log 'pass'
## Version 1.0.0
## License [MIT](LICENSE)
[travis]: https://img.shields.io/travis/nhz-io/nhz-io-md5.svg?style=flat
[npm]: https://img.shields.io/npm/v/@nhz.io/md5.svg?style=flat