Questions tagged [apache-commons-codec]

Apache Commons Codec provides implementations of common encoders and decoders such as Base64, Hex, Phonetic and URLs.

Apache Commons Codec was originally designed to be the definitive Base64 encoder, as there existed many different implementations.

While this package contains an abstract framework for the creation of encoders and decoders, Codec itself is primarily focused on providing functional utilities for working with common encodings.

http://commons.apache.org/proper/commons-codec/

63 questions
1
vote
0 answers

Display base64 encoded string as image in a PDF file using iText

I have a base64 encoded string. I want to display this as an image in a PDF file. I am using iText to achieve this. I am using apache commons codec to convert Base64 to byteArray.Below is the code - Document document = new Document(); …
Archit Arora
  • 2,508
  • 7
  • 43
  • 69
1
vote
1 answer

Unexpected results from Metaphone algorithm

I am using phonetic matching for different words in Java. i used Soundex but its too crude. i switched to Metaphone and realized it was better. However, when i rigorously tested it. i found weird behaviour. i was to ask whether thats the way…
jaykio77
  • 379
  • 1
  • 7
  • 22
1
vote
1 answer

Only one byte available in Base64InputStream

I have a String which (I think) is the base64 representation of a series of bytes. I am trying to obtain the bytes using org.apache.commons.codec.binary.Base64InputStream. However, apparently this stream has only one byte available. The string was…
abl
  • 5,970
  • 4
  • 25
  • 44
1
vote
1 answer

Sha1 hashed string correctly encoded in mysql but displayed differently as a Java string

I am currently developping a java program coupled with a mysql database using the Dao pattern. I have some user info to be stored in a table and I am storing a Sha1 hashed version of the original password string. I am using…
Zek101
  • 203
  • 4
  • 13
1
vote
1 answer

NoSuchMethodError: org.apache.commons.codec.binary.Base64.decode on Android

I'm experiencing this exception on a simple app in Android api 19 using commons-codec-1.9. Seems that Android use an old commons-codec library but I can't figure out because. I'm usign Android studio and my gradle file contains this: dependencies…
drenda
  • 5,846
  • 11
  • 68
  • 141
1
vote
0 answers

Scala compiler error - sha256 not a member of DigestUtils - why does 1.6 work, but 1.9-SNAPSHOT does not?

libraryDependencies += "commons-codec" % "commons-codec" % "1.9-SNAPSHOT" val bytes = DigestUtils.sha256(message) Throws compiler error: value sha256 is not a member of object org.apache.commons.codec.digest.DigestUtils But when I go to look at…
rbellamy
  • 5,683
  • 6
  • 38
  • 48
1
vote
1 answer

unable to install common codec jar file

I have downloaded common.codec binary jar file. Now I want to use the class org.apache.commons.codec.binary.Base64. But this folder contains four jar files namely common.codec-1.7.jar,commons-codec-1.7-javadoc.jar,…
user1331502
  • 7
  • 1
  • 3
1
vote
0 answers

DES encryption - Getting badpadding exception on call to cipher.dofinal

I have Java code that works. But in Android, it doesn't work. Actually I have to encrypt a string in java send it via https to android phone and decrypt it there. i am using apache commons codec for base64. Any advice why I get a…
1
vote
2 answers

java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException in JBoss AS 7

I am testing JBoss AS 7 prior to deployment with a .war file of an app running in a different server. I get this error when I try to log onto the database via the app: SEVERE [] (http--0.0.0.0-8080-4) java.lang.NoClassDefFoundError:…
0
votes
0 answers

ParseException with commons-codec 20041127.091804

We are currently using safe-svg 1.1.4 3rd party jar to validate the svg content. But when we upgrade to latest jar (1.1.6) we are facing below parsing exception in server level [error] java.text.ParseException: inconsistent module descriptor file…
Ind mat
  • 1
  • 1
0
votes
1 answer

No exception thrown from Base32 after commons-codec upgrade

I have a TOTP Authenticator project which generates a six-digit one-time password using TOTP (RFC 6238). Internally it uses Base32 class from Apache Commons Codec: Base32 base32 = new Base32(); Following the commons-codec upgrade 1.14 -> 1.15, a…
Boris
  • 22,667
  • 16
  • 50
  • 71
0
votes
0 answers

Maven transitive dependency on system scoped dependency

I have a spring boot project (2.1.3) in which I had to add a jar file supplied by one of our partners (Referred with com.aesenc group id). I added it as a system scoped dependency even though it is against the recommendation as this repo already had…
user11666461
  • 761
  • 7
  • 12
0
votes
2 answers

OutOfMemoryError with apache commons Base64 static method decodeBase64

While decoding an Base64 encoded string to byte array (Have to do this as I have a key which can act on byte array to decrypt), I am getting outOfMemory. What are the effective ways to handle this problem? Should I chunk my input encoded String into…
0
votes
0 answers

Cannot compute SHA-512 with DigestUtils

I have a function to compute SHA-512 digest. public Hash hash(byte[] data) { return new Hash(org.apache.commons.codec.digest.DigestUtils.sha512(data)); } It gives me the following error The method sha512(byte[]) is undefined for the type…
0
votes
2 answers

After trying to decode Base64, reciving E/AndroidRuntime: FATAL EXCEPTION: main

I´m building a simple app for android 4.4 and up, i have a method to decode base64 string using the apache-commons-codec library. import org.apache.commons.codec.binary.Base64; public static String decodeBase64(String toDecode) { byte[] decoded…
NormanP
  • 1
  • 2