<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>28551</bug_id>
          
          <creation_ts>2015-04-23 16:44:37 +0000</creation_ts>
          <short_desc>TODO: create example utility function that converts text -&gt; ArrayBufferView</short_desc>
          <delta_ts>2016-05-24 00:33:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Web Cryptography</product>
          <component>Web Cryptography API Document</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Thomson">martin.thomson</reporter>
          <assigned_to name="Ryan Sleevi">sleevi</assigned_to>
          <cc>public-webcrypto</cc>
    
    <cc>ttaubert</cc>
    
    <cc>w3</cc>
    
    <cc>watsonm</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>119821</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Thomson">martin.thomson</who>
    <bug_when>2015-04-23 16:44:37 +0000</bug_when>
    <thetext>Maybe use TextEncoder: https://encoding.spec.whatwg.org/#interface-textencoder</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119847</commentid>
    <comment_count>1</comment_count>
      <attachid>1598</attachid>
    <who name="Adam Hart">w3</who>
    <bug_when>2015-04-23 19:30:16 +0000</bug_when>
    <thetext>Created attachment 1598
Utility functions for converting text, base64, arrayBuffer

These have consistently worked for any UTF-8 I&apos;ve thrown at them for use with the web crypto API&apos;s</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119848</commentid>
    <comment_count>2</comment_count>
      <attachid>1598</attachid>
    <who name="Adam Hart">w3</who>
    <bug_when>2015-04-23 19:49:49 +0000</bug_when>
    <thetext>Comment on attachment 1598
Utility functions for converting text, base64, arrayBuffer

There are a few typos in the last two functions. Should be obvious, just remove the underscores. Sorry for that and for possibly not submitting this correctly -- first time on here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119871</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Taubert">ttaubert</who>
    <bug_when>2015-04-24 07:16:35 +0000</bug_when>
    <thetext>(In reply to Adam Hart from comment #1)
&gt; Created attachment 1598 [details]
&gt; Utility functions for converting text, base64, arrayBuffer

Converting string-&gt;base64 and then base64-&gt;abv (or the other way around) is not something we should suggest doing. TextEncoder, as mentioned by Martin above, is an API made for exactly that. I&apos;ve used it for all my examples so far and I think we should use it here too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126541</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2016-05-24 00:33:33 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/webcrypto/issues/81</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1598</attachid>
            <date>2015-04-23 19:30:16 +0000</date>
            <delta_ts>2015-04-23 19:49:49 +0000</delta_ts>
            <desc>Utility functions for converting text, base64, arrayBuffer</desc>
            <filename>utility_functions.js</filename>
            <type>application/javascript</type>
            <size>1076</size>
            <attacher name="Adam Hart">w3</attacher>
            
              <data encoding="base64">dmFyIGJhc2U2NFRvQXJyYXlCdWZmZXIgPSBmdW5jdGlvbiAoc3RyaW5nX2Jhc2U2NCkgew0KICB2
YXIgYmluYXJ5X3N0cmluZyA9ICBhdG9iKHN0cmluZ19iYXNlNj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