https://github.com/mtso/cha-0
CHA-0 Color Hashing Algorithm
https://github.com/mtso/cha-0
color hash hex string
Last synced: 5 months ago
JSON representation
CHA-0 Color Hashing Algorithm
- Host: GitHub
- URL: https://github.com/mtso/cha-0
- Owner: mtso
- License: mit
- Created: 2017-06-04T02:29:41.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-04T06:29:24.000Z (about 9 years ago)
- Last Synced: 2025-08-09T03:04:10.778Z (10 months ago)
- Topics: color, hash, hex, string
- Language: JavaScript
- Homepage: https://npm.runkit.com/cha-0
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CHA-0
CHA-0 is a color hashing algorithm designed to output a random hex color string for a given string input. CHA-0 gives a good distribution over the hex color space through a multiplicative hashing scheme.
[](https://travis-ci.org/mtso/cha-0)
## Install
With npm:
```
$ npm install --save cha-0
```
With yarn:
```
$ yarn add cha-0
```
## Usage
```js
const cha0 = require('cha-0')
const fooColor = cha0('foo')
console.log('#' + fooColor) // "#3dc680"
```
[Try it out at runkit.com](https://npm.runkit.com/cha-0)