Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/therebelrobot/randomart
OpenSSH randomart images library in JS, now with CLI!
https://github.com/therebelrobot/randomart
Last synced: 9 days ago
JSON representation
OpenSSH randomart images library in JS, now with CLI!
- Host: GitHub
- URL: https://github.com/therebelrobot/randomart
- Owner: therebelrobot
- Created: 2016-05-24T23:13:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-24T23:32:00.000Z (over 8 years ago)
- Last Synced: 2024-04-26T05:22:00.296Z (9 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
randomart-generator
====Generate OpenSSH style "randomart" images based on any data.
This is a shameless, cli port of [slapresta/randomart](https://github.com/slapresta/randomart), which is itself a shameless, slightly modified port of [calmh/randomart](https://github.com/calmh/randomart) to JS.
Example
====```javascript
randomart = require('randomart');
console.log(randomart([
0x9b, 0x4c, 0x7b, 0xce, 0x7a, 0xbd, 0x0a, 0x13,
0x61, 0xfb, 0x17, 0xc2, 0x06, 0x12, 0x0c, 0xed
]));
``````
.+.
o.
.. +
Eo =
S + .
o B . .
B o..
*...
.o+...
```Documentation
====The function returned by `require('randomart')` optionally accepts two arguments: the first one, `data`, is expected to be an array of integers between 0 and 255, while the second one, `options`, has the following structure, in which all parent elements are optional:
```json
{
"bounds": {
"width": 17,
"height": 9,
},
"symbols": {
"-2": "E",
"-1": "S",
"0": " ",
"1": ".",
[...]
"13": "/",
"14": "^"
}
}
```Credits
====Thanks to [@calmh](https://github.com/calmh) for their hard work! May the opensource gods reward them with seventy-two non-terrible window managers.