An open API service indexing awesome lists of open source software.

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

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")
```