https://github.com/scalajs-io/md5
JavaScript function for hashing messages with MD5
https://github.com/scalajs-io/md5
md5 md5-digest md5sum node nodejs npm scala scalajs
Last synced: about 1 month ago
JSON representation
JavaScript function for hashing messages with MD5
- Host: GitHub
- URL: https://github.com/scalajs-io/md5
- Owner: scalajs-io
- License: apache-2.0
- Created: 2017-02-06T02:36:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-17T23:09:40.000Z (over 6 years ago)
- Last Synced: 2025-01-17T22:42:35.739Z (9 months ago)
- Topics: md5, md5-digest, md5sum, node, nodejs, npm, scala, scalajs
- Language: Scala
- Size: 14.6 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MD5 API for Scala.js
================================
[MD5](https://www.npmjs.com/package/md5) - js function for hashing messages with MD5### Description
js function for hashing messages with MD5.
### Build Dependencies
* [SBT v1.2.x](http://www.scala-sbt.org/download.html)
### Build/publish the SDK locally
```bash
$ sbt clean publish-local
```### Running the tests
Before running the tests the first time, you must ensure the npm packages are installed:
```bash
$ npm install
```Then you can run the tests:
```bash
$ sbt test
```### Examples
Convert a string to MD5:
```scala
import io.scalajs.npm.md5._MD5("Hello Wold") //=> 7e1c79bda939ad9f46a382a56df147e1
```Convert a buffer to MD5:
```scala
import io.scalajs.nodejs.buffer.Buffer
import io.scalajs.npm.md5._val buffer = Buffer.from("Hello Wold")
MD5(buffer) //=> 7e1c79bda939ad9f46a382a56df147e1
```### Artifacts and Resolvers
To add the `MD5` binding to your project, add the following to your build.sbt:
```sbt
libraryDependencies += "io.scalajs.npm" %%% "md5" % "0.5.0"
```Optionally, you may add the Sonatype Repository resolver:
```sbt
resolvers += Resolver.sonatypeRepo("releases")
```