Git Product home page Git Product logo

cryptii's Introduction

cryptii

Build Status MIT license

Framework and web app for encoding and decoding text.

Quick start

  • Make sure you have node & npm, gulp and sass installed locally.
  • Clone the repo: git clone -b dev [email protected]:cryptii/cryptii.git
  • Install dev dependencies: npm install
  • Build repo: gulp build
  • Run tests: gulp test
  • Watch files: gulp

Core concepts

This framework and web app tries to reflect a wide variety of ciphers, encodings, encryptions and formats while keeping them easily combinable. Here are some basic assumptions that lay out the foundation of this library.

Bricks

There are two categories of Bricks: Encoders and Viewers. Both inherit directly from the Brick class which provides logic for managing settings, a view and serialisation.

Encoder objects manipulate content by encoding or decoding it in a specific way and with given settings.

let encoder = new ROT13Encoder()
encoder.setSettingValue('variant', 'rot47')
let result = encoder.encode('Hello World') // returns a Chain object
result.getString() // returns 'w6==@ (@C=5'

Viewer objects allow users to view and edit content in a specific way or format.

Chains

Chain objects encapsulate the actual content used and returned by Encoders and Viewers. This content can either be a string, an array of Unicode code points or a Uint8Array of bytes.

Chains are immutable. You define its content by passing one of these representations as first argument to the constructor.

let a = new Chain('๐ŸฆŠ๐Ÿš€')
let b = new Chain([129418, 128640])
let c = new Chain(new Uint8Array([240, 159, 166, 138, 240, 159, 154, 128]))
Chain.isEqual(a, b, c) // returns true

The object handles the translation between these representations lazily for you. You can access any of these through getter and additional convenience methods.

let string = chain.getString()
let codePoints = chain.getCodePoints()
let bytes = chain.getBytes()

cryptii's People

Contributors

ffraenz avatar maxg0 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.