return sign by 65 bytes r s id. id < 27
196224
function ECKeySign(hashBytes, priKeyBytes) {
  let ec = new EC('secp256k1');
  let key = ec.keyFromPrivate(priKeyBytes, 'bytes');
  let signature = key.sign(hashBytes);
  let r = signature.r;
  let s = signature.s;
  let id = signature.recoveryParam;
  let rHex = r.toString('hex');
  while (rHex.length < 64) {
    rHex = "0" + rHex;
  }
  let sHex = s.toString('hex');
  while (sHex.length < 64) {
    sHex = "0" + sHex;
  }
  let idHex = byte2hexStr(id);
  let signHex = rHex + sHex + idHex;
  return hexStr2byteArray(signHex);
}
556278
def get_function_id(sig):
    ''''
        
    '''
    s = sha3.keccak_256()
    s.update(sig.encode('utf-8'))
    return int("0x" + s.hexdigest()[:8], 16)
1060202
function Id (_id) {
  var dec
  var hex

  if (typeof _id === 'number') {
    dec = _id
    var tmp = ('00000000000000' + _id.toString(16))
    hex = tmp.substring(tmp.length - 12, tmp.length)
  }
  if (typeof _id === 'string') {
    dec = parseInt(_id, 16)
    hex = _id
  }
  if (typeof _id === 'undefined') {
    hex = sha1((~~(Math.random() * 1e9)).toString(36) + Date.now())
      .substring(0, 12)
    dec = parseInt(hex, 16)
  }

  this.toHex = function () {
    return hex
  }

  this.toDec = function () {
    return dec
  }

  this.next = function () {
    if (hex === maxHex) {
      return '000000000000'
    } else {
      var a = ('000000000000' + ((dec + 1).toString(16)))
      return a.substring(a.length - 12, a.length)
    }
  }

  return this
}
370736
def checksumPid(s)
			tmp = crc32(s)
			crc = tmp ^ (tmp >> 16)
			res = s
			l = LETTERS.length
			for i in 0..1 do
				b = crc & 0xFF
				t = b.divmod(l)[0]
				pos = t ^ (b % l)
				res = "#{res}#{LETTERS[pos % l]}"
				crc >>= 8
			end
			res
		end
861615
def decode_setid(encoded):
    """"""
    try:
        lo, hi = struct.unpack('<QQ', b32decode(encoded.upper() + '======'))
    except struct.error:
        raise ValueError('Cannot decode {!r}'.format(encoded))
    return (hi << 64) + lo
318925
def sign(self, data: bytes, v: int = 27) -> Signature:
        
        assert v in (0, 27), 'Raiden is only signing messages with v in (0, 27)'
        _hash = eth_sign_sha3(data)
        signature = self.private_key.sign_msg_hash(message_hash=_hash)
        sig_bytes = signature.to_bytes()
        # adjust last byte to v
        return sig_bytes[:-1] + bytes([sig_bytes[-1] + v])
936839
def Sign(self, message, use_pss=False):
    """"""
    precondition.AssertType(message, bytes)

    # TODO(amoser): This should use PSS by default at some point.
    if not use_pss:
      padding_algorithm = padding.PKCS1v15()
    else:
      padding_algorithm = padding.PSS(
          mgf=padding.MGF1(hashes.SHA256()), salt_length=padding.PSS.MAX_LENGTH)

    return self._value.sign(message, padding_algorithm, hashes.SHA256())
1192854
public static String asString(byte id) {
        switch (id) {
            case STOP:
                return "stop(0)";
            case VOID:
                return "void(1)";
            case BOOL:
                return "bool(2)";
            case BYTE:
                return "byte(3)";
            case DOUBLE:
                return "double(4)";
            // case 5:
            case I16:
                return "i16(6)";
            // case 7:
            case I32:
                // ENUM is same as I32.
                return "i32(8)";
            // case 9:
            case I64:
                return "i64(10)";
            case STRING:
                // BINARY is same as STRING.
                return "string(11)";
            case STRUCT:
                return "struct(12)";
            case MAP:
                return "map(13)";
            case SET:
                return "set(14)";
            case LIST:
                return "list(15)";
            default:
                return "unknown(" + id + ")";
        }
    }
838301
def str2rsi(key):
    
    rlzi, sid, imt = key.split('/')
    return int(rlzi[4:]), int(sid[4:]), imt
77983
def get_plaintext_to_sign(self):
        
        as_strings = self.pack_subdomain()
        if self.sig is not None:
            # don't sign the signature
            as_strings = as_strings[:-1]

        return ",".join(as_strings)
1334074
def _read_id_numbers(self):
        """"""
        _byte = self._read_fileng(4)
        _addr = '.'.join([str(_) for _ in _byte])
        return _addr
423228
private static String getVerifyCode(String idNumber) {
        int sum = 0;
        for (int i = 0; i < 17; i++) {
            sum = sum + Integer.parseInt(String.valueOf(idNumber.charAt(i))) * Integer.parseInt(Wi[i]);
        }
        return ValCodeArr[sum % 11];
    }
1330900
function mkid (id) {
    id = id.toLowerCase();
    id = xre.replace(id, xre("\\s+", "sg"), "_");
    id = xre.replace(id, xre("-", "sg"), "_");
    return id;
}
796869
public long expectSigned(int bytes) throws IOException {
        switch (bytes) {
            case 8:
                return expectLong();
            case 4:
                return expectInt();
            case 2:
                return expectShort();
            case 1:
                return expectByte();
        }
        throw new IllegalArgumentException("Unsupported byte count for signed: " + bytes);
    }
377979
def _SignedVarintSize(value):
  """"""
  if value < 0: return 10
  if value <= 0x7f: return 1
  if value <= 0x3fff: return 2
  if value <= 0x1fffff: return 3
  if value <= 0xfffffff: return 4
  if value <= 0x7ffffffff: return 5
  if value <= 0x3ffffffffff: return 6
  if value <= 0x1ffffffffffff: return 7
  if value <= 0xffffffffffffff: return 8
  if value <= 0x7fffffffffffffff: return 9
  return 10
860788
def sign(key, qs):
    """"""
    sig = derive_signature(key, qs)
    return "%s&%s" % (qs, urlencode([("sig", sig)]))
1070301
def sign(data, low_r = true, extra_entropy = nil)
      sig = secp256k1_module.sign_data(data, priv_key, extra_entropy)
      if low_r && !sig_has_low_r?(sig)
        counter = 1
        until sig_has_low_r?(sig)
          extra_entropy = [counter].pack('I*').bth.ljust(64, '0').htb
          sig = secp256k1_module.sign_data(data, priv_key, extra_entropy)
          counter += 1
        end
      end
      sig
    end