title: Validate Base64 encoded 256 bit numbers for digital signature keys
body: <p>I've seen many RegEx answers on how to check for Base64, but I can't find one specifically for representations of 256-bit numbers.</p>
  
  <p>I'm brand new to Base64, byte conversions, and RegEx.  <a href="https://stackoverflow.com/a/475217/1382306">This answer</a> seems to be the best for checking Base64, but I can't tell from the details if it can be specifically applied to a representation of a 256-bit number.</p>
  
  <pre><code>^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
  </code></pre>
  
  <p>I need to make sure of the validity of these strings because I'm using them as encodings of Ed25519 keys, and my <a href="http://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Base64.html" rel="nofollow noreferrer">en/decoder</a> seems to accept non-ASCII characters.</p>
  
  <p>I don't really understand if that can specifically be applied to a representation of a 256-bit number.</p>
  
  <p>How can RegEx validate a Base64 encoded 256 bit number?</p>