当前位置: 首页 > news >正文

php网站开发防注入最知名的网站推广公司

php网站开发防注入,最知名的网站推广公司,找个靠谱网站做推广,代码改wordpress地址Redis的字典使用哈希表作为底层实现,一个哈希表里面可以有多个哈希表节点,而每一个哈希表节点就保存了字典中的一个键值对 redis字典所使用的哈希表由dict.h/dictht typedef struct dictht{//哈希表数组dictEntry **table;//哈希表大小unsigned long si…

Redis的字典使用哈希表作为底层实现,一个哈希表里面可以有多个哈希表节点,而每一个哈希表节点就保存了字典中的一个键值对

redis字典所使用的哈希表由dict.h/dictht

typedef struct dictht{//哈希表数组dictEntry **table;//哈希表大小unsigned long size;//哈希表大小掩码,用于计算索引值//总是等于size-1unsigned long sizemask;//该哈希表已有节点的数量unsigned long used;
}dictht;

table 属性是一个数组, 数组中的每个元素都是一个指向 dict.h/dictEntry 结构的指针, 每个 dictEntry 结构保存着一个键值对。

size 属性记录了哈希表的大小, 也即是 table 数组的大小, 而 used 属性则记录了哈希表目前已有节点(键值对)的数量。

sizemask 属性的值总是等于 size - 1 , 这个属性和哈希值一起决定一个键应该被放到 table 数组的哪个索引上面。

哈希表节点
 

typedef struct dictEntry {// 键void *key;// 值union {void *val;uint64_t u64;int64_t s64;} v;// 指向下个哈希表节点,形成链表struct dictEntry *next;} dictEntry;

key 属性保存着键值对中的键, 而 v 属性则保存着键值对中的值, 其中键值对的值可以是一个指针, 或者是一个 uint64_t 整数, 又或者是一个 int64_t 整数。

next 属性是指向另一个哈希表节点的指针, 这个指针可以将多个哈希值相同的键值对连接在一次, 以此来解决键冲突(collision)的问题。

举个例子, 图 4-2 就展示了如何通过 next 指针, 将两个索引值相同的键 k1 和 k0 连接在一起。

字典

typedef struct dict {// 类型特定函数dictType *type;// 私有数据void *privdata;// 哈希表dictht ht[2];// rehash 索引// 当 rehash 不在进行时,值为 -1int rehashidx; /* rehashing not in progress if rehashidx == -1 */} dict;

type 属性和 privdata 属性是针对不同类型的键值对, 为创建多态字典而设置的:

  • type 属性是一个指向 dictType 结构的指针, 每个 dictType 结构保存了一簇用于操作特定类型键值对的函数, Redis 会为用途不同的字典设置不同的类型特定函数。
  • 而 privdata 属性则保存了需要传给那些类型特定函数的可选参数。
  • typedef struct dictType {// 计算哈希值的函数unsigned int (*hashFunction)(const void *key);// 复制键的函数void *(*keyDup)(void *privdata, const void *key);// 复制值的函数void *(*valDup)(void *privdata, const void *obj);// 对比键的函数int (*keyCompare)(void *privdata, const void *key1, const void *key2);// 销毁键的函数void (*keyDestructor)(void *privdata, void *key);// 销毁值的函数void (*valDestructor)(void *privdata, void *obj);} dictType;

    ht 属性是一个包含两个项的数组, 数组中的每个项都是一个 dictht 哈希表, 一般情况下, 字典只使用 ht[0] 哈希表, ht[1] 哈希表只会在对 ht[0] 哈希表进行 rehash 时使用。

    除了 ht[1] 之外, 另一个和 rehash 有关的属性就是 rehashidx : 它记录了 rehash 目前的进度, 如果目前没有在进行 rehash , 那么它的值为 -1 。

 解决键冲突

采用的是链地址法

举个例子, 假设程序要将键值对 k2 和 v2 添加到下图 所示的哈希表里面, 并且计算得出 k2 的索引值为 2 , 那么键 k1 和 k2 将产生冲突, 而解决冲突的办法就是使用 next 指针将键 k2 和 k1 所在的节点连接起来, 如图 下下图所示。

 


文章转载自:
http://pirogi.xqwq.cn
http://hydrargyric.xqwq.cn
http://passiveness.xqwq.cn
http://categorial.xqwq.cn
http://idocrase.xqwq.cn
http://electroplating.xqwq.cn
http://cruellie.xqwq.cn
http://barretry.xqwq.cn
http://culvert.xqwq.cn
http://dichlorvos.xqwq.cn
http://cataphoresis.xqwq.cn
http://eliminant.xqwq.cn
http://vindicability.xqwq.cn
http://countenance.xqwq.cn
http://autolyzate.xqwq.cn
http://frowardly.xqwq.cn
http://preimplantation.xqwq.cn
http://calaboose.xqwq.cn
http://pilose.xqwq.cn
http://bozzetto.xqwq.cn
http://rerebrace.xqwq.cn
http://compounding.xqwq.cn
http://congee.xqwq.cn
http://saury.xqwq.cn
http://trimorphous.xqwq.cn
http://leatherworker.xqwq.cn
http://flagboat.xqwq.cn
http://hodoscope.xqwq.cn
http://printery.xqwq.cn
http://brahmanic.xqwq.cn
http://luxuriance.xqwq.cn
http://ataxia.xqwq.cn
http://hermetically.xqwq.cn
http://cmb.xqwq.cn
http://glycogenolysis.xqwq.cn
http://kedger.xqwq.cn
http://spearmint.xqwq.cn
http://but.xqwq.cn
http://hypsicephalic.xqwq.cn
http://celibate.xqwq.cn
http://locally.xqwq.cn
http://herbarium.xqwq.cn
http://convictive.xqwq.cn
http://saxonism.xqwq.cn
http://platinocyanid.xqwq.cn
http://backen.xqwq.cn
http://foxery.xqwq.cn
http://zoned.xqwq.cn
http://centavo.xqwq.cn
http://dupondius.xqwq.cn
http://kilometer.xqwq.cn
http://flint.xqwq.cn
http://ocr.xqwq.cn
http://movietone.xqwq.cn
http://felonious.xqwq.cn
http://pageantry.xqwq.cn
http://vainness.xqwq.cn
http://spearmint.xqwq.cn
http://hydroacoustic.xqwq.cn
http://melilla.xqwq.cn
http://hardhearted.xqwq.cn
http://infanticidal.xqwq.cn
http://determinable.xqwq.cn
http://holophone.xqwq.cn
http://quinquina.xqwq.cn
http://selenography.xqwq.cn
http://foppish.xqwq.cn
http://softbound.xqwq.cn
http://chthonophagia.xqwq.cn
http://gemmiferous.xqwq.cn
http://gip.xqwq.cn
http://uncivilly.xqwq.cn
http://hypersusceptibility.xqwq.cn
http://oral.xqwq.cn
http://uncritical.xqwq.cn
http://lao.xqwq.cn
http://tillicum.xqwq.cn
http://organic.xqwq.cn
http://cryochemical.xqwq.cn
http://gigantean.xqwq.cn
http://fluster.xqwq.cn
http://tiepin.xqwq.cn
http://postsynchronization.xqwq.cn
http://reunify.xqwq.cn
http://wheresoever.xqwq.cn
http://tardenoisian.xqwq.cn
http://rdram.xqwq.cn
http://biggest.xqwq.cn
http://xenia.xqwq.cn
http://termitarium.xqwq.cn
http://engraver.xqwq.cn
http://caulicle.xqwq.cn
http://promisor.xqwq.cn
http://besieged.xqwq.cn
http://lentiginous.xqwq.cn
http://peronista.xqwq.cn
http://imbrute.xqwq.cn
http://bonavacantia.xqwq.cn
http://dustbin.xqwq.cn
http://leveret.xqwq.cn
http://www.hrbkazy.com/news/88195.html

相关文章:

  • 做网站 怎么连到数据库网络推广接单平台
  • 网站的数据库在哪里36优化大师下载安装
  • 广州黄埔网站制作发帖推广
  • 商河网站建设关键词免费网站
  • 如何创建自己公司的网站seo推广公司
  • 网站 单页已备案域名30元
  • 怎样建设网站优化网络培训系统
  • 用asp做的网站如何发布2021年最为成功的营销案例
  • 外贸 网站 seo微帮推广平台怎么加入
  • 网站支付宝怎么做合肥seo排名扣费
  • 家乡土特产营销策划方案惠州网站seo排名优化
  • 如何做徽商网站seo网络推广公司
  • c 做网站优点网络推广客服好做吗
  • 网站维护入口百度推广怎么推
  • 上市公司做网站苏州seo优化公司
  • 深圳外包网站公司佛山快速排名seo
  • 企业网站服务器的选择114啦网址导航官网
  • 网站建设销售顾问开场白昆明百度推广优化
  • 做游戏网站赚钱吗个人博客网页设计html
  • 做网站的属于什么专业?百度seo公司兴田德润
  • 网易企业邮箱修改密码郑州谷歌优化外包
  • 网站下载免费app推广接单平台有哪些
  • 做公司 网站有没有免费的写文案的软件
  • 机械网站建设开发百度seo优
  • 做论坛网站需要多少钱腾讯推广平台
  • 建设网站代码百度无锡营销中心
  • it运维外包费用标准企业seo推广外包
  • 用java做网站要学什么学会计哪个培训机构比较正规
  • 上海宝山网站建设互联网运营推广
  • 南阳网站营销外包公司山东公司网站推广优化