projetos-codic-ibict / dark-algorithms

Decentralized implementation of the Nice Opaque Identifiers (NOId)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dARK-algorithms

DOI

image alt ><

This repository contains a Solidity implementation of the Nice Opaque Identifiers (NOId), including the Noid Check Digit Algorithm (NCDA). This implementation enables the Archival Resource Key (ARK) minting process in decentralized environments, like Blockchain technology.

The code presented in this repository represents a small contribution to the decentralized Archival Resource Key (dARK) project, which intends to leverage Blockchain technology to improve the ARK.

Content

  • NOID
  • NCDA

NOID Detail

See the NOID source code.

NCDA Detail

    function noid_ncda(string memory id) 
    public view
    returns (string memory output) {
        
        bytes memory bid = bytes(id);


        uint256 val = 0;
        for (uint i=0; i<bid.length; i++ ){
            bytes1 _char = bid[i];
            uint prod = (i + 1) * get_char_pos(_char);
            val = val + prod;
        }

        string memory _vd = get_char_at(uint8(val % alphabet_len));
        // output = 

        return string(abi.encodePacked(id, _vd));
    }

For further detail see the NCDA source code.

About

Decentralized implementation of the Nice Opaque Identifiers (NOId)


Languages

Language:Solidity 100.0%