All Downloads are FREE. Search and download functionalities are using the official Maven repository.

common.Bits Maven / Gradle / Ivy

Go to download

This is a collection of JAVA libraries that implement Unbound cryptographic classes for JAVA provider, PKCS11 wrapper, cryptoki, and advapi

There is a newer version: 42761
Show newest version
package com.unbound.common;

public class Bits
{
  public static int get(byte[] src, int bitIndex)
  {
    int offset = bitIndex >> 3;
    bitIndex &= 7;
    return (src[offset]>>bitIndex) & 1;
  }

  public static void set(byte[] dst, int bitIndex, int bit)
  {
    int offset = bitIndex >> 3;
    bitIndex &= 7;
    bit <<= bitIndex;
    dst[offset] &= ~(1<




© 2015 - 2024 Weber Informatics LLC | Privacy Policy