diff --git a/lib/codecs.js b/lib/codecs.js
index <HASH>..<HASH> 100644
--- a/lib/codecs.js
+++ b/lib/codecs.js
@@ -3,7 +3,13 @@
  * Current id.
  */
 
-var id = 0;
+var id = 1;
+
+/**
+ * Max codecs.
+ */
+
+var max = 9;
 
 /**
  * Name map.
@@ -23,6 +29,7 @@ exports.define = function(name, fns){
   if ('string' != typeof name) throw new Error('codec name required');
   if ('function' != typeof fns.encode) throw new Error('codec .encode required');
   if ('function' != typeof fns.decode) throw new Error('codec .decode required');
+  if (id === max) throw new Error('too many codecs');
 
   exports[name] = {
     encode: fns.encode,
Sets a maximum number of codecs defined and changes the intial codec.id too 1 rather than 0.