Skip to main content

Reversible obfuscated identifier hashes.

Project description

Copyright 2013-2019 Nathan Lucas

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Description: # BaseHash

[![Build Status](https://travis-ci.org/bnlucas/python-basehash.png?branch=master)](https://travis-ci.org/bnlucas/python-basehash)

BaseHash is a small library for creating reversible obfuscated identifier hashes to a given base and length. The project is based on the GO library, [PseudoCrypt][pc] by [Kevin Burns][kb]. The library is extendible to use custom alphabets and other bases.

The library uses golden primes and the [Baillie-PSW][bp] primality test or the gmpy2.is_prime (if available) for hashing to maximum length (base ** length - 1).

## v3.0.5

A massive overhaul was done with the primality algorithms. Including support for [gmpy2][gmp] if it available on the system for that much more of an increase.

All methods being used to check primality in primes.py have been optimized and benchmarked to try to get the best possible preformance when gmpy2.is_prime and gmpy2.next_prime are not available.

## Install

` pip install basehash `

## Testing

` nosetests tests/ `

[pc]: https://github.com/KevBurnsJr/pseudocrypt [kb]: https://github.com/KevBurnsJr [bp]: http://en.wikipedia.org/wiki/Baillie-PSW_primality_test [gmp]: https://gmpy2.readthedocs.org/

Keywords: base,encoding,hash,hashing,security Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Programming Language :: Python Classifier: License :: OSI Approved :: Apache Software License Classifier: Intended Audience :: Developers Classifier: Operating System :: OS Independent Classifier: Topic :: Scientific/Engineering :: Mathematics Classifier: Topic :: Security Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Utilities Description-Content-Type: text/markdown

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for BaseHash, version 3.0.8
Filename, size File type Python version Upload date Hashes
Filename, size BaseHash-3.0.8.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page