diff --git a/model/sync-digest.cc b/model/sync-digest.cc
index a6f91f7..5ff9418 100644
--- a/model/sync-digest.cc
+++ b/model/sync-digest.cc
@@ -27,15 +27,79 @@
 #include <boost/exception/errinfo_at_line.hpp>
 
 // for printing, may be disabled in optimized build
-#include <boost/archive/iterators/base64_from_binary.hpp>
-#include <boost/archive/iterators/base64_from_binary.hpp>
+
+// #ifdef DIGEST_BASE64
+// #include <boost/archive/iterators/base64_from_binary.hpp>
+// #include <boost/archive/iterators/binary_from_base64.hpp>
+// #endif
+
 #include <boost/archive/iterators/transform_width.hpp>
+#include <boost/iterator/transform_iterator.hpp>
+#include <boost/archive/iterators/dataflow_exception.hpp>
 
 using namespace boost;
+using namespace boost::archive::iterators;
 using namespace std;
 
-using namespace boost::archive::iterators;
-typedef base64_from_binary<transform_width<string::const_iterator, 6, 8> > base64_t;
+// Other options: VP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_sha256, EVP_dss, EVP_dss1, EVP_mdc2, EVP_ripemd160
+#define HASH_FUNCTION EVP_sha1
+
+
+// #ifndef DIGEST_BASE64
+
+template<class CharType>
+struct hex_from_4_bit
+{
+  typedef CharType result_type;
+  CharType operator () (CharType ch) const
+  {
+    const char *lookup_table = "0123456789abcdef";
+    // cout << "New character: " << (int) ch << " (" << (char) ch << ")" << "\n";
+    BOOST_ASSERT (ch < 16);
+    return lookup_table[static_cast<size_t>(ch)];
+  }
+};
+
+typedef transform_iterator<hex_from_4_bit<string::const_iterator::value_type>,
+                           transform_width<string::const_iterator, 4, 8, string::const_iterator::value_type> > string_from_binary;
+
+
+template<class CharType>
+struct hex_to_4_bit
+{
+  typedef CharType result_type;
+  CharType operator () (CharType ch) const
+  {
+    const signed char lookup_table [] = {
+      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1,
+      -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+    };
+
+    // cout << "New character: " << hex << (int) ch << " (" << (char) ch << ")" << "\n";
+    signed char value = -1;
+    if ((unsigned)ch < 128)
+      value = lookup_table [(unsigned)ch];
+    if (value == -1)
+      throw Sync::DigestCalculationError () << errinfo_at_line (__LINE__);
+    
+    return value;
+  }
+};
+
+typedef transform_width<transform_iterator<hex_to_4_bit<string::const_iterator::value_type>, string::const_iterator>, 8, 4> string_to_binary;
+
+// #else
+
+// typedef base64_from_binary<transform_width<string::const_iterator, 6, 8> > string_from_binary;
+// typedef binary_from_base64<transform_width<string::const_iterator, 8, 6> > string_to_binary;
+
+// #endif
 
 namespace Sync {
 
@@ -65,7 +129,7 @@
       m_buffer = 0;
     }
 
-  int ok = EVP_DigestInit_ex (m_context, EVP_sha1 (), 0);
+  int ok = EVP_DigestInit_ex (m_context, HASH_FUNCTION (), 0);
   if (!ok)
     throw DigestCalculationError () << errinfo_at_line (__LINE__);
 }
@@ -76,7 +140,7 @@
 {
   if (m_buffer != 0) return;
 
-  m_buffer = new uint8_t [HASH_SIZE];
+  m_buffer = new uint8_t [EVP_MAX_MD_SIZE];
 
   int ok = EVP_DigestFinal_ex (m_context,
 			       m_buffer, &m_hashLength);
@@ -115,6 +179,8 @@
 void
 Digest::update (const uint8_t *buffer, size_t size)
 {
+  // cout << "Update: " << (void*)buffer << " / size: " << size << "\n";
+  
   // cannot update Digest when it has been finalized
   if (m_buffer != 0)
     throw DigestCalculationError () << errinfo_at_line (__LINE__);
@@ -136,26 +202,40 @@
   return *this;
 }
 
-
-std::ostream&
-Digest::print (std::ostream &os) const
+std::ostream &
+operator << (std::ostream &os, const Digest &digest)
 {
-  BOOST_ASSERT (m_hashLength != 0);
+  BOOST_ASSERT (digest.m_hashLength != 0);
   
   ostreambuf_iterator<char> out_it (os); // ostream iterator
   // need to encode to base64
-  copy (base64_t (reinterpret_cast<const char*> (m_buffer)),
-        base64_t (reinterpret_cast<const char*> (m_buffer+m_hashLength)),
+  copy (string_from_binary (reinterpret_cast<const char*> (digest.m_buffer)),
+        string_from_binary (reinterpret_cast<const char*> (digest.m_buffer+digest.m_hashLength)),
         out_it);
 
   return os;
 }
 
-std::ostream &
-operator << (std::ostream &os, const Digest &digest)
+std::istream &
+operator >> (std::istream &is, Digest &digest)
 {
-  digest.print (os);
-  return os;
+  string str;
+  is >> str; // read string first
+  // uint8_t padding = (3 - str.size () % 3) % 3;
+  // for (uint8_t i = 0; i < padding; i++) str.push_back ('=');
+
+  // only empty digest object can be used for reading
+  if (digest.m_buffer != 0)
+    throw DigestCalculationError () << errinfo_at_line (__LINE__);
+
+  digest.m_buffer = new uint8_t [EVP_MAX_MD_SIZE];
+  uint8_t *end = copy (string_to_binary (str.begin ()),
+                       string_to_binary (str.end ()),
+                       digest.m_buffer);
+
+  digest.m_hashLength = end - digest.m_buffer;
+
+  return is;
 }
 
 
diff --git a/model/sync-digest.h b/model/sync-digest.h
index 7c7174c..f5c83f6 100644
--- a/model/sync-digest.h
+++ b/model/sync-digest.h
@@ -29,8 +29,6 @@
 
 namespace Sync {
 
-const std::size_t HASH_SIZE = 160;
-
 /**
  * @ingroup sync
  * @brief A simple wrapper for libcrypto hash functions
@@ -97,9 +95,6 @@
   // inline Digest &
   // operator << (INT value);
 
-  std::ostream&
-  print (std::ostream &os) const;
-  
 private:
   /**
    * @brief Disabled copy operator 
@@ -118,6 +113,12 @@
    */
   void
   update (const uint8_t *buffer, size_t size);
+
+  friend std::ostream &
+  operator << (std::ostream &os, const Digest &digest);
+
+  friend std::istream &
+  operator >> (std::istream &is, Digest &digest);
   
 private:
   EVP_MD_CTX *m_context;
@@ -147,6 +148,9 @@
 std::ostream &
 operator << (std::ostream &os, const Digest &digest);
 
+std::istream &
+operator >> (std::istream &is, Digest &digest);
+
 // template<class INT>
 // Digest &
 // Digest::operator << (INT value)
diff --git a/model/sync-std-name-info.cc b/model/sync-std-name-info.cc
new file mode 100644
index 0000000..5b57fbe
--- /dev/null
+++ b/model/sync-std-name-info.cc
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ *         卞超轶 Chaoyi Bian <bcy@pku.edu.cn>
+ *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "sync-std-name-info.h"
+
+using namespace std;
+
+namespace Sync {
+
+
+NameInfoConstPtr
+StdNameInfo::FindOrCreate (const std::string &key)
+{
+  NameInfoPtr value = NameInfoPtr (new StdNameInfo (key));
+  pair<NameMap::iterator,bool> item =
+    m_names.insert (make_pair (key, value));
+
+  return item.first->second;
+}
+
+StdNameInfo::StdNameInfo (const std::string &name)
+  : m_name (name)
+{
+  m_id = m_ids ++; // set ID for a newly inserted element
+  m_digest << name;
+  m_digest.getHash (); // finalize digest
+}
+
+string
+StdNameInfo::toString () const
+{
+  return m_name;
+}
+
+bool
+StdNameInfo::operator == (const NameInfo &info) const
+{
+  try
+    {
+      return m_name == dynamic_cast<const StdNameInfo&> (info).m_name;
+    }
+  catch (...)
+    {
+      return false;
+    }
+}
+
+} // Sync
+
diff --git a/model/sync-std-name-info.h b/model/sync-std-name-info.h
new file mode 100644
index 0000000..34b853a
--- /dev/null
+++ b/model/sync-std-name-info.h
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ *         卞超轶 Chaoyi Bian <bcy@pku.edu.cn>
+ *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef SYNC_STD_NAME_INFO_H
+#define SYNC_STD_NAME_INFO_H
+
+#include "sync-name-info.h"
+#include <string>
+
+namespace Sync {
+
+class StdNameInfo : public NameInfo
+{
+public:
+  /**
+   * @brief Lookup existing or create new NameInfo object
+   * @param name routable prefix
+   */
+  static NameInfoConstPtr
+  FindOrCreate (const std::string &name);
+
+  virtual ~StdNameInfo () { };
+  
+  // from NameInfo
+  virtual bool
+  operator == (const NameInfo &info) const;
+
+  virtual std::string
+  toString () const;
+
+private:
+  // implementing a singleton pattern. 
+  /**
+   * @brief Disabled default constructor. NameInfo object should be created through FindOrCreate static call.
+   */
+
+  /**
+   * @brief Disabled default
+   */
+  StdNameInfo () {}
+  StdNameInfo& operator = (const StdNameInfo &info) { return *this; }
+  StdNameInfo (const std::string &name);
+  
+  std::string m_name;
+};
+
+} // Sync
+
+#endif // SYNC_CCNX_NAME_INFO_H
diff --git a/test/testapp.cc b/test/testapp.cc
index 900f6d9..51921d5 100644
--- a/test/testapp.cc
+++ b/test/testapp.cc
@@ -21,27 +21,30 @@
  */
 
 #include "../model/sync-digest.h"
+#include <boost/lexical_cast.hpp>
 #include <iostream>
+#include <sstream>
 
 using namespace Sync;
 using namespace std;
+using namespace boost;
 
 int
 main (int argc, char **argv)
 {
   Digest test;
-  test << "1";
+  test << "1\n";
 
-  try
-    {
-      cout << "Trying to print without explicit getHash() call: ";
-      cout << test;
-      cout << "Failed (should be asserted)\n";
-    }
-  catch (...)
-    {
-      cout << "OK (exception)\n";
-    }
+  // try
+  //   {
+  //     cout << "Trying to print without explicit getHash() call: ";
+  //     cout << test;
+  //     cout << "Failed (should be asserted)\n";
+  //   }
+  // catch (...)
+  //   {
+  //     cout << "OK (exception)\n";
+  //   }
   
   // without explicit finalizing, Digest will not be complete and printing out will cause assert
   test.getHash ();
@@ -65,5 +68,32 @@
     {
       cout << "OK (exception)\n";
     }
+
+  Digest test2;
+// #ifdef DIGEST_BASE64
+//   string testString = "sCYyTGkEsqnLS4jW1hyB0Q==";
+// #else
+  string testString = lexical_cast<string> (test); //"b026324c6904b2a9cb4b88d6d61c81d1";
+// #endif
+  cout << "Hash from string: " << testString << "\n";
+  istringstream is (testString);
+  is >> test2;
+
+  cout << "Result from hash: " << test2 << "\n";
+
+  cout << "Compare two hashes: " << (test == test2) << "\n";
+
+  Digest test3;
+  if (testString[0] != '1')
+    testString[0] = '1';
+  else
+    testString[0] = '2';
+  
+  istringstream is2(testString);
+  is2 >> test3;
+
+  cout << "Hash from string: " << test3 << "\n";
+  cout << "Compare two hashes: " << (test == test3) << "\n";
+  
   return 0; 
 }
diff --git a/wscript b/wscript
index c62e6f2..60c7aa1 100644
--- a/wscript
+++ b/wscript
@@ -10,6 +10,7 @@
     conf.check_cfg(atleast_pkgconfig_version='0.20')
     conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL')
     conf.define ('STANDALONE', 1)
+    # conf.define ('DIGEST_BASE64', 1) # base64 is not working and probably will not work at all
 
     conf.check_tool('boost')
     conf.check_boost(lib='signals filesystem iostreams regex')
