Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/npkgz/modhex
modhex encoding/decoding used by Yubico-OTP Authentication
https://github.com/npkgz/modhex
authentication javascript modhex nodejs otp yubico yubico-otp yubikey
Last synced: about 2 months ago
JSON representation
modhex encoding/decoding used by Yubico-OTP Authentication
- Host: GitHub
- URL: https://github.com/npkgz/modhex
- Owner: npkgz
- License: mit
- Created: 2017-06-17T07:46:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T02:38:50.000Z (over 1 year ago)
- Last Synced: 2024-08-11T11:05:32.944Z (5 months ago)
- Topics: authentication, javascript, modhex, nodejs, otp, yubico, yubico-otp, yubikey
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/modhex
- Size: 93.8 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/AndiDittrich/Node.modhex.svg?branch=master)](https://travis-ci.org/AndiDittrich/Node.modhex)
modhex
=========================[modhex](https://developers.yubico.com/yubico-c/Manuals/modhex.1.html) encoding/decoding used by [Yubico-OTP Authentication](https://developers.yubico.com/OTP/)
```
yarn add modhex --save
```Features
------------------------------* Encode Data to modhex
* Decode modhex StringsAPI
------------------------------* [encode](#encode) - Encode Data to modhex
* [decode](#decode) - Decode modhex Stringsencode
------------------------------**Description:** Encode Data to modhex
**Syntax:** `data:ModhexString = encode(data:HexString|Buffer)`
**Arguments:**
* data:HexString|Buffer - Input data as hex-String or Buffer
**Example:**
```js
const _modex = require('modhex');// encode hex data
const data0 = _modex.encode('5834b135dc124d38c');// encode buffer
const mybuffer = Buffer.from('5834b135dc124d38c', 'hex');
const data1 = _modhex.encode(mybuffer);
```decode
------------------------------**Description:** Decode modhex Strings
**Syntax:** `data:HexString|Buffer = decode(data:ModhexString, [encoding:String])`
**Arguments:**
* data:ModhexString - Input data as modhex
* encoding:String(optional) - Output encoding {**hex**, **buffer**} default: hex**Example:**
```js
const _modex = require('modhex');// decode modhex data to hex
const data0 = _modex.encode('iijbeetrkrtlghuddhdhhjdej');// decode modhex to buffer
const data1 = _modhex.encode('iijbeetrkrtlghuddhdhhjdej', 'buffer');
```Any Questions ? Report a Bug ? Enhancements ?
---------------------------------------------
Please open a new issue on [GitHub](https://github.com/AndiDittrich/Node.modhex/issues)License
-------
modhex is OpenSource and licensed under the Terms of [The MIT License](LICENSE.md)