c#-php代码转C#代码,来个会PHP和C#的高手
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
풀어 주다: 2016-06-02 11:34:17
phpc#
<code>public static function oath_hotp($key, $counter){ $bin_counter = pack('N*', 0) . pack('N*', $counter); // Counter must be 64-bit int $hash = hash_hmac ('sha1', $bin_counter, $key, true); return str_pad(self::oath_truncate($hash), self::otpLength, '0', STR_PAD_LEFT);}public static function oath_truncate($hash){ $offset = ord($hash[19]) & 0xf; return ( ((ord($hash[$offset+0]) & 0x7f) </code>
로그인 후 복사
self::otpLength是类中的一个变量
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
저자별 최신 기사
-
2025-02-24 12:36:12
-
2025-02-24 12:11:09
-
2025-02-24 12:06:10
-
2025-02-24 12:04:13
-
2025-02-24 12:03:10
-
2025-02-24 12:02:09
-
2025-02-24 12:01:10
-
2025-02-24 12:00:16
-
2025-02-24 11:59:10
-
2025-02-24 11:58:14