All Projects → benwilber → bashids

benwilber / bashids

Licence: Apache-2.0 License
Pure Bash implementation of the hashid algorithm from http://hashids.org/

Programming Languages

shell
77523 projects

Labels

Projects that are alternatives of or similar to bashids

Laravel Hashids
A Hashids bridge for Laravel
Stars: ✭ 1,714 (+4410.53%)
Mutual labels:  hashids
laravel-hashids
Laravel package for Hashids
Stars: ✭ 52 (+36.84%)
Mutual labels:  hashids
objection-hashid
Objection plugin to automatically obfuscate model ids using hashids!
Stars: ✭ 13 (-65.79%)
Mutual labels:  hashids
Laravel Fakeid
Automatic model ID obfuscation in routes for Laravel
Stars: ✭ 161 (+323.68%)
Mutual labels:  hashids
Eloquent Hashids
On-the-fly hashids for Laravel Eloquent models. (🍰 Easy & ⚡ Fast)
Stars: ✭ 196 (+415.79%)
Mutual labels:  hashids
hashids.sql
PL/pgSQL implementation of hashids library
Stars: ✭ 40 (+5.26%)
Mutual labels:  hashids
Acts as hashids
Use Youtube-Like ID in ActiveRecord seamlessly.
Stars: ✭ 76 (+100%)
Mutual labels:  hashids
laravel-hashid
HashId Implementation on Laravel Eloquent ORM
Stars: ✭ 23 (-39.47%)
Mutual labels:  hashids
Hashid Rails
Use Hashids (http://hashids.org/ruby/) in your Rails app ActiveRecord models.
Stars: ✭ 225 (+492.11%)
Mutual labels:  hashids
eloquent-hashids
Automatically generate and persist Hashids for newly created Eloquent models.
Stars: ✭ 17 (-55.26%)
Mutual labels:  hashids
Pg hashids
Short unique id generator for PostgreSQL, using hashids
Stars: ✭ 164 (+331.58%)
Mutual labels:  hashids
Django Rest Framework Serializer Extensions
Extensions to help DRY up Django Rest Framework serializers
Stars: ✭ 180 (+373.68%)
Mutual labels:  hashids
hashids-bundle
Integrates hashids/hashids in a Symfony project
Stars: ✭ 43 (+13.16%)
Mutual labels:  hashids
Laravel Hashslug
Package providing a trait to use Hashids on a model
Stars: ✭ 136 (+257.89%)
Mutual labels:  hashids
id-mask
IDMask is a Java library for masking internal ids (e.g. from your DB) when they need to be published to hide their actual value and to prevent forging. It has support optional randomisation has a wide support for various Java types including long, UUID and BigInteger. This library bases its security on strong cryptographic primitives.
Stars: ✭ 39 (+2.63%)
Mutual labels:  hashids
Laravel Optimus
Transform your internal id's to obfuscated integers based on Knuth's integer hash. Laravel wrapper for the Optimus Library by Jens Segers with multiple connections support.
Stars: ✭ 119 (+213.16%)
Mutual labels:  hashids
django-hashids
Non-intrusive hashids library for Django
Stars: ✭ 26 (-31.58%)
Mutual labels:  hashids
idy
👓 An ID obfuscator for ActiveRecord
Stars: ✭ 15 (-60.53%)
Mutual labels:  hashids
harsh
Hashids implementation in Rust
Stars: ✭ 48 (+26.32%)
Mutual labels:  hashids
hashids.pm
Hashids, ported for Perl
Stars: ✭ 15 (-60.53%)
Mutual labels:  hashids

bashids

ghit.me Build Status

Pure Bash implementation of the hashid algorithm from Hashids.org

Usage

$ bashids -h
usage: bashids (-e|-d) [-s SALT -l MIN_LENGTH -a ALPHABET]  (hashid|ints)
    -e <encode>
    -d <decode>
    -s SALT (default: "")
    -l MIN_LENGTH (default: 0)
    -a ALPHABET (default: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890)
    -h <help>

Encoding

$ bashids -e -s MySalt 25 46 57
1liJyCK1

Decoding

$ bashids -d -s MySalt 1liJyCK1
25
46
57

Tests

bashids uses the bats BASH testing framework for tests.

Running tests

$ bats tests.bats 
 ✓ encode: empty
 ✓ encode: default salt
 ✓ encode: single number
 ✓ encode: zero hash
 ✓ encode: multiple numbers
 ✓ encode: salt
 ✓ encode: alphabet
 ✓ encode: minimum length
 ✓ encode: all parameters
 ✓ encode: alphabet without standard separators
 ✓ encode: alphabet with two standard separators
 ✓ encode: negative numbers
 ✓ encode: float numbers
 ✓ decode: empty
 ✓ decode: default salt
 ✓ decode: single number
 ✓ decode: multiple numbers
 ✓ decode: salt
 ✓ decode: alphabet
 ✓ decode: minimum length
 ✓ decode: all parameters
 ✓ decode: invalid hash
 ✓ decode: alphabet without standard separators
 ✓ decode: alphabet with two standard separators

24 tests, 0 failures
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].