All Projects → essentialkaos → branca

essentialkaos / branca

Licence: MIT license
Authenticated encrypted API tokens (IETF XChaCha20-Poly1305 AEAD) for Golang

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to branca

Stellar Contracts
Stellar contract examples and components
Stars: ✭ 36 (-30.77%)
Mutual labels:  tokens
Figma Theme
Generate development-ready theme JSON files from Figma Styles
Stars: ✭ 130 (+150%)
Mutual labels:  tokens
Go Guardian
Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to create powerful modern API and web authentication.
Stars: ✭ 204 (+292.31%)
Mutual labels:  tokens
Figmagic Example
Using Figmagic (simplifying design token generation and asset extraction) with Webpack 5, React 16, Styled Components.
Stars: ✭ 37 (-28.85%)
Mutual labels:  tokens
Tokenscript
TokenScript schema, specs and paper
Stars: ✭ 89 (+71.15%)
Mutual labels:  tokens
Ubtokenbar
Flexible and extensible UICollectionView based TokenBar written in Swift
Stars: ✭ 136 (+161.54%)
Mutual labels:  tokens
Pay Protocol
fixing the transition to a cashless world
Stars: ✭ 29 (-44.23%)
Mutual labels:  tokens
Multisigwallet
Ethereum MultiSigWallet
Stars: ✭ 230 (+342.31%)
Mutual labels:  tokens
Tokens
Tokens, Tokens, Tokens
Stars: ✭ 101 (+94.23%)
Mutual labels:  tokens
Web3 By Example
Node.js with Web3 javascript examples for getting basic information (transactions, balances, network stats, and tokens) from the Ethereum blockchain.
Stars: ✭ 156 (+200%)
Mutual labels:  tokens
Djforge Redis Multitokens
Django Rest Framework Redis MultiTokens
Stars: ✭ 40 (-23.08%)
Mutual labels:  tokens
Coin registry
A global registry of JSON formatted files on 1500+ cryptocurrency tokens. Provides information like chat rooms, communities, explorers, and contact information on each coin. Used by https://blockmodo.com, DEXs, developers, and exchanges.
Stars: ✭ 85 (+63.46%)
Mutual labels:  tokens
Tokens
Java library for conveniently verifying and storing OAuth 2.0 service access tokens
Stars: ✭ 142 (+173.08%)
Mutual labels:  tokens
Eth Scan
An efficient Ether and token balance scanner library
Stars: ✭ 35 (-32.69%)
Mutual labels:  tokens
Token Lists
📚 The Token Lists specification
Stars: ✭ 208 (+300%)
Mutual labels:  tokens
Flask Httpauth
Simple extension that provides Basic, Digest and Token HTTP authentication for Flask routes
Stars: ✭ 951 (+1728.85%)
Mutual labels:  tokens
Figma Tokens
Official Repo of the Figma Plugin 'Figma Tokens'
Stars: ✭ 134 (+157.69%)
Mutual labels:  tokens
Awesome Buggy Erc20 Tokens
A Collection of Vulnerabilities in ERC20 Smart Contracts With Tokens Affected
Stars: ✭ 251 (+382.69%)
Mutual labels:  tokens
Csrf
Logic behind CSRF token creation and verification.
Stars: ✭ 226 (+334.62%)
Mutual labels:  tokens
Tokens
Ethereum token definitions
Stars: ✭ 144 (+176.92%)
Mutual labels:  tokens

PkgGoDev GoReportCard Coverage Status Codebeat badge GitHub Actions CI Status GitHub Actions CodeQL Status

InstallationUsage exampleBenchmarksBuild StatusLicense


branca.go is branca token specification implementation for Golang 1.16+.

Features and benefits:

  • Pure Go implementation;
  • No third-party dependencies at all;
  • 100% code coverage;
  • Fuzz tests.

Installation

Make sure you have a working Go 1.17+ workspace (instructions), then:

go get github.com/essentialkaos/branca

For update to latest stable release, do:

go get -u github.com/essentialkaos/branca

Usage example

package main

import (
  "fmt"
  
  "github.com/essentialkaos/branca"
)

func main() {
  key := "abcd1234abcd1234abcd1234abcd1234"
  brc, err := branca.NewBranca([]byte(key))

  if err != nil {
    fmt.Printf("Error: %v\n", err)
    return
  }

  payload := "MySuperSecretData"
  token, err := brc.EncodeToString([]byte(payload))

   if err != nil {
    fmt.Printf("Error: %v\n", err)
    return
  }

  fmt.Printf("Token: %s\n", token)
}

Benchmarks

You can run benchmarks by yourself using make bench command.

BrancaSuite.BenchmarkBase62Decoding            1000000     1046 ns/op      384 B/op      6 allocs/op
BrancaSuite.BenchmarkBase62Encoding            1000000     1913 ns/op      512 B/op      6 allocs/op
BrancaSuite.BenchmarkBrancaDecoding            5000000      373 ns/op       48 B/op      2 allocs/op
BrancaSuite.BenchmarkBrancaDecodingFromString  1000000     1463 ns/op      432 B/op      8 allocs/op
BrancaSuite.BenchmarkBrancaEncoding            1000000     1677 ns/op      208 B/op      4 allocs/op
BrancaSuite.BenchmarkBrancaEncodingToString     500000     3977 ns/op      720 B/op     10 allocs/op

Build Status

Branch Status
master CI
develop CI

License

MIT

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].