Array returns an array of all hash types in the set
()
| 356 | |
| 357 | // Array returns an array of all hash types in the set |
| 358 | func (h Set) Array() (ht []Type) { |
| 359 | v := int(h) |
| 360 | i := uint(0) |
| 361 | for v != 0 { |
| 362 | if v&1 != 0 { |
| 363 | ht = append(ht, Type(1<<i)) |
| 364 | } |
| 365 | i++ |
| 366 | v >>= 1 |
| 367 | } |
| 368 | return ht |
| 369 | } |
| 370 | |
| 371 | // Count returns the number of hash types in the set |
| 372 | func (h Set) Count() int { |