dat-encoding

WebJar for dat-encoding

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

dat-encoding
Last Version

Last Version

5.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

dat-encoding
WebJar for dat-encoding
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dat-land/dat-encoding

Download dat-encoding

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/dat-encoding/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>dat-encoding</artifactId>
    <version>5.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/dat-encoding/
implementation 'org.webjars.npm:dat-encoding:5.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/dat-encoding/
implementation ("org.webjars.npm:dat-encoding:5.0.1")
'org.webjars.npm:dat-encoding:jar:5.0.1'
<dependency org="org.webjars.npm" name="dat-encoding" rev="5.0.1">
  <artifact name="dat-encoding" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='dat-encoding', version='5.0.1')
)
libraryDependencies += "org.webjars.npm" % "dat-encoding" % "5.0.1"
[org.webjars.npm/dat-encoding "5.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : safe-buffer jar [5.0.1,6)

Project Modules

There are no modules declared in this project.

dat-encoding

Dat's way of encoding and decoding dat links.

Build Status

Example

var encoding = require('dat-encoding')

var link = '6161616161616161616161616161616161616161616161616161616161616161'
var buf = encoding.decode(link)
console.log('%s -> %s', link, buf)
console.log('%s -> %s', buf, encoding.encode(buf))

API

.encode(buf)

.toStr(buf)

Encode buf into a hex string. Throws if buf isn't 32 bytes of length.

If buf is already a string, checks if it's valid and returns it.

.decode(str)

.toBuf(str)

Decode str into its binary representation. Also supports dat:// and dat.com/ links. Throws if the raw link isn't 64 bytes of base64.

If str is already a buffer, checks if it's valid and returns it.

License

MIT

org.webjars.npm

datland

Versions

Version
5.0.1