// 
// Decompiled by Procyon v0.6.0
// 

package com.nimbusds.jose.util;

import java.math.BigInteger;
import com.nimbusds.jose.shaded.jcip.Immutable;

@Immutable
public class Base64URL extends Base64
{
    public Base64URL(final String base64URL) {
        super(base64URL);
    }
    
    @Override
    public boolean equals(final Object object) {
        return object instanceof Base64URL && this.toString().equals(object.toString());
    }
    
    public static Base64URL from(final String base64URL) {
        if (base64URL == null) {
            return null;
        }
        return new Base64URL(base64URL);
    }
    
    public static Base64URL encode(final byte[] bytes) {
        return new Base64URL(Base64Codec.encodeToString(bytes, true));
    }
    
    public static Base64URL encode(final BigInteger bigInt) {
        return encode(BigIntegerUtils.toBytesUnsigned(bigInt));
    }
    
    public static Base64URL encode(final String text) {
        return encode(text.getBytes(StandardCharset.UTF_8));
    }
}
