src/elements/Tag.js
function Tag(value, parameters) {
    abstractions.Element.call(this, utilities.types.TAG, parameters);
    value = value || 20;  // the default number of bytes
    var bytes, numberOfBytes, hash;
    switch (typeof value) {
        case 'number':
            numberOfBytes = value;
            bytes = utilities.random.bytes(value);
            value = utilities.codex.base32Encode(bytes);
            break;
        case 'string':
            bytes = utilities.codex.base32Decode(value);
            numberOfBytes = bytes.length;
            break;
    }
    hash = utilities.codex.bytesToInteger(bytes);  // the first four bytes work perfectly

    // since this element is immutable the attributes must be read-only
    this.getSize = function() { return numberOfBytes; };
    this.getValue = function() { return value; };
    this.getHash = function() { return hash; };

    return this;
}
function Tag(value, parameters) {
    abstractions.Element.call(this, utilities.types.TAG, parameters);
    value = value || 20;  // the default number of bytes
    var bytes, numberOfBytes, hash;
    switch (typeof value) {
        case 'number':
            numberOfBytes = value;
            bytes = utilities.random.bytes(value);
            value = utilities.codex.base32Encode(bytes);
            break;
        case 'string':
            bytes = utilities.codex.base32Decode(value);
            numberOfBytes = bytes.length;
            break;
    }
    hash = utilities.codex.bytesToInteger(bytes);  // the first four bytes work perfectly

    // since this element is immutable the attributes must be read-only
    this.getSize = function() { return numberOfBytes; };
    this.getValue = function() { return value; };
    this.getHash = function() { return hash; };

    return this;
}
function Tag ( value , parameters ) { abstractions . Element . call ( this , utilities . types . TAG , parameters ) ; value = value || 20 ; // the default number of bytes var bytes , numberOfBytes , hash ; switch ( typeof value ) { case 'number' : numberOfBytes = value ; bytes = utilities . random . bytes ( value ) ; value = utilities . codex . base32Encode ( bytes ) ; break ; case 'string' : bytes = utilities . codex . base32Decode ( value ) ; numberOfBytes = bytes . length ; break ; } hash = utilities . codex . bytesToInteger ( bytes ) ; // the first four bytes work perfectly // since this element is immutable the attributes must be read-only this . getSize = function ( ) { return numberOfBytes ; } ; this . getValue = function ( ) { return value ; } ; this . getHash = function ( ) { return hash ; } ; return this ; }
PUBLIC CONSTRUCTOR 
This constructor creates a new tag element using the specified value.

@param {Number|String} value An optional parameter defining the size of a new random
tag or the value it should represent.
@param {Parameters} parameters Optional parameters used to parameterize this element.
@returns {Tag} The new tag element.
PUBLIC CONSTRUCTOR This constructor creates a new tag element using the specified value .