module NamedInformation

Overview

implementation of rfc6920

Defined in:

named_information.cr

Constant Summary

ALGORITHM_ID = {"1" => {algorithm: "SHA256", truncate: nil.as(Int32 | ::Nil)}, "2" => {algorithm: "SHA256", truncate: 128.as(Int32 | ::Nil)}, "3" => {algorithm: "SHA256", truncate: 120.as(Int32 | ::Nil)}, "4" => {algorithm: "SHA256", truncate: 96.as(Int32 | ::Nil)}, "5" => {algorithm: "SHA256", truncate: 64.as(Int32 | ::Nil)}, "6" => {algorithm: "SHA256", truncate: 32.as(Int32 | ::Nil)}}
VERSION = "1.0.1"

Class Method Summary

Class Method Detail

def self.algorithm_name(algorithm : String, truncate : Int32 | Nil) : String #

[View source]
def self.character_from_code_point(code_point : Int32) : Char #

[View source]
def self.code_point_from_character(char : Char) : Int32 #

[View source]
def self.convert_to_human_speakable(hash : Bytes, algorithm_name : String, checkdigit : Bool) : String #

[View source]
def self.generate_bin(content : String | Bytes, truncate : Int32 | Nil = nil, algorithm : String = "SHA256") : BinHash #

[View source]
def self.generate_hash(content : String | Bytes, authority : String | Nil = nil, truncate : Int32 | Nil = nil, algorithm : String = "SHA256") : Hash #

[View source]
def self.generate_human_speakable(content : String | Bytes, truncate : Int32 | Nil = nil, algorithm : String | Int32 = "SHA256", checkdigit : Bool = true) : String #

[View source]
def self.generate_segment(content : String | Bytes, truncate : Int32 | Nil = nil, algorithm : String = "SHA256") : String #

[View source]
def self.generate_u128(content : String | Bytes) : UInt128 #

[View source]
def self.generate_uri(content : String | Bytes, authority : String | Nil = nil, truncate : Int32 | Nil = nil, algorithm : String = "SHA256") : String #

[View source]
def self.generate_well_known(content : String | Bytes, authority : String | Nil = nil, truncate : Int32 | Nil = nil, algorithm : String = "SHA256") : String #

[View source]
def self.hash_content(content : String | Bytes, algorithm : String, truncate : Int32 | Nil = nil) #

Return hash of the content using the given algorithm, with optional truncation


[View source]
def self.luhn_checkdigit(input : String, n : Int32 = 16) : Char #

Compute the Luhn check digit for a given number string


[View source]