+/**
+ * Obtain a bit from a hashcode.
+ * @param code the GNUNET_CRYPTO_hash to index bit-wise
+ * @param bit index into the hashcode, [0...511] where 0 is the rightmost bit
+ * (bytes in code interpreted little endian)
+ * @return Bit \a bit from hashcode \a code, -1 for invalid index
+ */
+int
+GNUNET_CRYPTO_hash_get_bit_rtl (const struct GNUNET_HashCode *code,
+ unsigned int bit)
+{
+ GNUNET_assert (bit < 8 * sizeof(struct GNUNET_HashCode));
+ return (((unsigned char *) code)[bit >> 3] & (1 << (bit & 7))) > 0;
+}
+
+