package a.c.d.h;

import com.google.common.primitives.UnsignedBytes;
import java.util.Calendar;

public class a {

    /* renamed from: a  reason: collision with root package name */
    public static final String f133a = "UTF-8";

    public static int a(byte b, byte b2, byte b3, byte b4) {
        return (b & UnsignedBytes.MAX_VALUE) | ((b2 & UnsignedBytes.MAX_VALUE) << 8) | ((b3 & UnsignedBytes.MAX_VALUE) << 16) | ((b4 & UnsignedBytes.MAX_VALUE) << 24);
    }

    public static String a(byte[] bArr, int i) {
        if (bArr.length < i) {
            return null;
        }
        StringBuilder sb = new StringBuilder();
        for (int i2 = 0; i2 < i; i2++) {
            sb.append(String.format("%02x-", Byte.valueOf(bArr[i2])));
        }
        return sb.toString();
    }

    public static byte[] a(int i) {
        byte[] bArr = new byte[4];
        for (int i2 = 0; i2 < 4; i2++) {
            bArr[i2] = (byte) (i & 255);
            i >>= 8;
        }
        return bArr;
    }

    public static byte[] a(Calendar calendar) {
        return a((int) (calendar.getTimeInMillis() / 1000));
    }
}
