搜索结果
查询Tags标签: 漫话,共有 19条记录-
漫话Redis源码之十七
sha是典型的哈希算法,我曾经在博客中写过源码来实现,现在只需要读懂源码就可以了。 这是安全相关的函数,其实,很多安全函数都是挺难读懂的,里面各种奇奇怪怪的数字。 void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len) {WORD i;for (i = 0; i <…
2021/11/28 19:10:19 人评论 次浏览 -
漫话Redis源码之十七
sha是典型的哈希算法,我曾经在博客中写过源码来实现,现在只需要读懂源码就可以了。 这是安全相关的函数,其实,很多安全函数都是挺难读懂的,里面各种奇奇怪怪的数字。 void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len) {WORD i;for (i = 0; i <…
2021/11/28 19:10:19 人评论 次浏览 -
漫话Redis源码之二
看了一下,zipmapDecodeLength的实现还挺巧妙的,直接使用内存操作:/* Decode the encoded length pointed by p */ static unsigned int zipmapDecodeLength(unsigned char *p) {unsigned int len = *p;if (len < ZIPMAP_BIGLEN) return len;memcpy(&len,p+1,siz…
2021/11/22 2:09:45 人评论 次浏览 -
漫话Redis源码之二
看了一下,zipmapDecodeLength的实现还挺巧妙的,直接使用内存操作:/* Decode the encoded length pointed by p */ static unsigned int zipmapDecodeLength(unsigned char *p) {unsigned int len = *p;if (len < ZIPMAP_BIGLEN) return len;memcpy(&len,p+1,siz…
2021/11/22 2:09:45 人评论 次浏览