For this purpose, you use the hash class in Ruby, which allows you to create key-value pairs (in what appears to be an array), but then easily reference them later by key.
为此,您可以使用Ruby中的hash类,它允许您创建键值对(类似于数组),但是随后可以轻松地通过键引用它们。
Internally, the class maintains a hash table of all pooled objects.
在内部,类负责维护所汇聚的全部对象的哈希表。
This class builds a hash table of key-value pairs at the class instantiation.
此类在类实例化时构建一个键值对哈希表。
Use the MessageDigest class to hash the byte array, dealing with the appropriate exceptions, as shown in Listing 12 below.
使用MessageDigest类对字节数组进行哈希,处理相关异常,如清单12所示。
I used a hash map as a class attribute, but had to construct a key that included the country, the region, and the page start, as shown in the LoadCities method.
我使用一个散列映射作为类属性,但是必须构造一个包含国家、地区和页面起点的键,见LoadCities方法。
This hash map associates the field descriptor string for a generic class without any parameter types to the GenericTemplate for that class.
这个哈希映射把没有参数类型的泛型类的字段描述符字符串与这个类的GenericTemplate关联起来。
Unless you know how to generate a good hash code, the one generated from the Arrays class is bound to be better, resulting in fewer collisions.
如果您不知道如何生成良好的哈希码,那么最好使用arrays类,它能产生更少冲突。
The Datatype class must provide some object representation of the type that the validator can use for equality comparison and hash code calculation.
datatype类必须提供类型的某种对象表示,以便验证器可用来进行相等性比较和计算散列码。
The String class specifies a similar algorithm to be used for computing the hash value of a String.
String类规定类似的算法用于计算 String 的散列值。
For example, suppose that you have a class that stores user information and service information in two separate hash tables, as shown in Listing 3.
例如,假设您有一个类,它用两个单独的散列表来存储用户信息和服务信息,如清单3所示。
For this example, this store is implemented with a simple, ephemeral hash table and is provided with a factory for generating the implementation class (Listings 3 and 4).
对于这个示例来说,这个存储器是由一个简单且短暂的散列表实现的,并由一个生成实现类的工厂提供(清单3和清单4)。
Note that the variable_map class resembles a hash table in many respects.
请注意,variable_map类在许多方面与哈希表非常相似。
How to generate a unique object hash based on the class attributes?
如何生成一个基于类的属性的独特的对象的哈希?
When overridden in a derived class, gets an instance of the specified keyed hash algorithm.
在派生类中重写时,获取指定的加密哈希算法的实例。
When overridden in a derived class, serves as a hash function for the specified object for hashing algorithms and data structures, such as a hash table.
当在派生类中被重写时,用作指定对象的哈希算法和数据结构(如哈希表)的哈希函数。
When overridden in a derived class, gets the hash code for the specified object.
当在派生类中重写时,将获取指定对象的哈希代码。
When overridden in a derived class, serves as a hash function for hashing algorithms and data structures, such as a hash table.
在衍生类别中覆写时,做为杂凑演算法和资料结构之指定物件的杂凑函式,例如杂凑表。
When overridden in a derived class, sets the hash algorithm to use for creating the signature.
当在派生类中重写时,设置用于创建签名的哈希算法。
When overridden in a derived class, sets the hash algorithm to use for creating the signature.
当在派生类中重写时,设置用于创建签名的哈希算法。
应用推荐