protected function encodeKey(Buffer $key, $enc = null)
    {
        if ("hex" === $enc || (int) $enc == 16) {
            return $key->getHex();
        }
        elseif ("uint8" === $enc || (int) $enc == 8) {
            return $key->toUInt8();
        }
        elseif ("int32" === $enc || (int) $enc == 32) {
            $encoder = new Encoder;
            return $encoder->ua2words($key->toUInt8());
        }

        return $key;
    }
protected function encodeKey(Buffer $key, $enc = null)
    {
        if ("hex" === $enc || (int) $enc == 16) {
            return $key->getHex();
        }
        elseif ("uint8" === $enc || (int) $enc == 8) {
            return $key->toUInt8();
        }
        elseif ("int32" === $enc || (int) $enc == 32) {
            $encoder = new Encoder;
            return $encoder->ua2words($key->toUInt8());
        }

        return $key;
    }
protected function encodeKey ( Buffer $ key , $ enc = null ) { if ( "hex" === $ enc || ( int ) $ enc == 16 ) { return $ key -> getHex ( ) ; } elseif ( "uint8" === $ enc || ( int ) $ enc == 8 ) { return $ key -> toUInt8 ( ) ; } elseif ( "int32" === $ enc || ( int ) $ enc == 32 ) { $ encoder = new Encoder ; return $ encoder -> ua2words ( $ key -> toUInt8 ( ) ) ; } return $ key ; }
This method encodes a given `key` to the given `enc` codec or
returns the Buffer itself if no encoding was specified.

@param   \NEM\Core\Buffer    $key        The Key object (Buffer) that needs to be encoded.
@param   string|integer      $enc        Which encoding to use (One of: "hex", "uint8", "int32")
@return  \NEM\Core\Buffer|string|array   Returns either of Buffer, string hexadecimal representation, or UInt8 or Int32 array.
This method encodes a given key to the given enc codec or returns the Buffer itself if no encoding was specified .