https://github.com/hustcc/string-shorten
Shorten a string with crc32 and radix.
https://github.com/hustcc/string-shorten
crc32 radix shorten string string-shorten url-shorten
Last synced: 6 months ago
JSON representation
Shorten a string with crc32 and radix.
- Host: GitHub
- URL: https://github.com/hustcc/string-shorten
- Owner: hustcc
- Created: 2018-09-27T08:37:53.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-30T12:00:28.000Z (about 7 years ago)
- Last Synced: 2025-02-14T04:27:48.996Z (8 months ago)
- Topics: crc32, radix, shorten, string, string-shorten, url-shorten
- Language: JavaScript
- Size: 6.84 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# string-shorten
> Shorten a string with crc32 and radix. [Try online](https://runkit.com/hustcc/string-shorten).
[](https://travis-ci.org/hustcc/string-shorten)
[](https://coveralls.io/github/hustcc/string-shorten)
[](https://www.npmjs.com/package/string-shorten)
[](https://www.npmjs.com/package/string-shorten)## Usage
> **npm i --save string-shorten**
```js
var shorten = require('string-shorten');shorten('世界,你好'); // 'oTM]^'
shorten('Shorten a string with crc32 and radix.'); // 'e:::%'
```**Warning**: base on crc32 algorithm which has collision probability: `216555` english words, `2` collisions.
## License
MIT@[hustcc](https://github.com/hustcc).