{"id":19094445,"url":"https://github.com/risto-stevcev/randomart-js","last_synced_at":"2025-06-24T14:39:32.333Z","repository":{"id":65371894,"uuid":"78378706","full_name":"Risto-Stevcev/randomart-js","owner":"Risto-Stevcev","description":"Generates a randomart image from a buffer","archived":false,"fork":false,"pushed_at":"2017-01-10T01:25:50.000Z","size":1490,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-31T00:37:28.458Z","etag":null,"topics":["art","crypto","cryptography","javascript","random","randomart"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Risto-Stevcev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-08T23:59:16.000Z","updated_at":"2025-01-23T18:10:10.000Z","dependencies_parsed_at":"2023-01-20T01:32:06.334Z","dependency_job_id":null,"html_url":"https://github.com/Risto-Stevcev/randomart-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Risto-Stevcev/randomart-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Risto-Stevcev%2Frandomart-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Risto-Stevcev%2Frandomart-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Risto-Stevcev%2Frandomart-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Risto-Stevcev%2Frandomart-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Risto-Stevcev","download_url":"https://codeload.github.com/Risto-Stevcev/randomart-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Risto-Stevcev%2Frandomart-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261695316,"owners_count":23195728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["art","crypto","cryptography","javascript","random","randomart"],"created_at":"2024-11-09T03:29:12.339Z","updated_at":"2025-06-24T14:39:32.308Z","avatar_url":"https://github.com/Risto-Stevcev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# randomart-js\n\nGenerates a randomart image from a buffer or hexadecimal string. This implementation is based off of the \"drunken bishop\" paper:\n\n[The drunken bishop: An analysis of the OpenSSH fingerprint visualization algorithm][paper]  \n*Dirk Loss, Tobias Limmer\u003csup\u003e\u0026dagger;\u003c/sup\u003e, Alexander von Gernler\u003csup\u003e\u0026Dagger;\u003c/sup\u003e*\n\nHere is an example animation of the walk for the hash used in the paper:\n\n![Example animation][example]\n\n## Usage\n\nNode:\n\n```js\nvar randomart = require('randomart-js')\nrandomart.render('fc94b0c1e5b0987c5843997697ee9fb7')\n```\n\nStandalone:\n\n```js\nrandomart.render('fc94b0c1e5b0987c5843997697ee9fb7')\n```\n\n## API\n\n`render`(*String or Buffer*, *[Object]*): *[[String]]*\n\nRenders the randomart image as a 2d array. It takes the following properties in the optional config object:\n\n- height: *Int* (default: `9`)\n- width: *Int* (default: `17`)\n- trail: *Boolean* (default: `false`)\n- values: *Array* (default: `[' ','.','o','+','=','*','B','O','X','@','%','\u0026','#','/','^']`)\n\nThe `trail` property will return an array of randomart images, showing the progression from start to end.\nThe `values` property determines how the trail in the walk is encoded. It defaults to the canonical representation.\n\n- - -\n\n`hexToBuffer`(*String*): *Buffer*\n\nCreates a buffer out of a hexadecimal string. Useful for the browser standalone.\n\n- - -\n\n`gridToString`(*[[String]]*): *String*\n\nTakes a 2d array (the randomart image) and converts it into a pretty printed string.\n\n- - -\n\n`bufferToBinaryPairs`(*Buffer*): *[String]*\n\nConverts a buffer into an array of binary pairs, ie. `['11', '01', '00', ...]`.\n\n- - -\n\n`getWalk`(*[String]*): *[Object]*\n\nTakes an array of binary pairs and returns the walk of coordinates, ie. `[{ x: 8, y: 4 }, { x: 7, y: 3 }, ...]`.\n\n- - -\n\n`walkToNumeric`(*[Object]*): *[Int]*\n\nTakes a walk in the format from `getWalk` and returns the walk formatted in the representation given in the \n\"drunken bishop\" paper, ie. `[76, 58, 76, ...]`.\n\n\n## Example\n\nSee the `example` folder and this [JSbin](http://jsbin.com/dugenuwiqe/1/embed?live)\n\n\n[paper]: http://www.dirk-loss.de/sshvis/drunken_bishop.pdf\n[example]: https://raw.githubusercontent.com/Risto-Stevcev/randomart-js/master/example.gif\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fristo-stevcev%2Frandomart-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fristo-stevcev%2Frandomart-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fristo-stevcev%2Frandomart-js/lists"}